﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using OnTheWay;

namespace Models
{
    public enum ExhibitClassEnum
    {
        展示,人物,活动,企业联盟,视频
    }

    [DataBaseTable]
    public class Exhibit : OnTheWay.Models.Model
    {
        /// <summary>
        /// 分类
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(int), Detail = "分类", EnumType = typeof(ExhibitClassEnum))]
        public virtual int Class { get; set; }
        /// <summary>
        /// 类型ID
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(Guid), NotNullable = true)]
        public virtual Guid TypeID { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "类型", NotNullable = true, Length = 64)]
        public virtual string TypeName { get; set; }
        /// <summary>
        /// 封面图片
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), NotNullable = true)]
        public virtual string MooMaUrl { get; set; }
        /// <summary>
        /// 赞助方ID
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(Guid), NotNullable = true)]
        public virtual Guid SponsorID { get; set; }
        /// <summary>
        /// 赞助方 封面
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), NotNullable = true)]
        public virtual string SponsorMooMaUrl { get; set; }
        /// <summary>
        /// 被赞数
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(int), Detail = "被赞数", NotNullable = true)]
        public virtual int PraiseCount { get; set; }
        /// <summary>
        /// 详细描述
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "详细描述", NotNullable = true)]
        public virtual string Description { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), Detail = "作者", NotNullable = false, Length = 64)]
        public virtual string Author { get; set; }
        /// <summary>
        /// 热门
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(bool), Detail = "热门", NotNullable = true)]
        public virtual bool IsHotspot { get; set; }
        /// <summary>
        /// 相关ID
        /// </summary>
        [DataMember]
        [DataBaseMember(typeof(string), NotNullable = true)]
        public virtual string RelateIDs { get; set; }
        /// <summary>
        /// 分类枚举
        /// </summary>
        public virtual ExhibitClassEnum ClassEnum
        {
            get { return (ExhibitClassEnum)Class; }
            set { Class = (int)value; }
        }

        public Exhibit()
        {
            this.RelateIDs = String.Empty;
            this.Description = String.Empty;
            this.SponsorMooMaUrl = String.Empty;
        }
    }
}
